﻿Imports System.Collections.ObjectModel
Imports System.Data.Common
Imports System.Collections.Generic
Imports System.Runtime.InteropServices
Imports System.Data.SqlClient
Imports System.Data
Imports Microsoft.Practices.EnterpriseLibrary.Data

Imports BusinessEntities

<Serializable()> _
Public Class EvaluacionDA
    Inherits Base
    Implements iEvaluacionDAO


    Public Function RegistrarEvaluacion(ByVal objBE As EvaluacionBE) As Boolean Implements iEvaluacionDAO.RegistrarEvaluacion
        Try
            Using command As DbCommand = Me.DataBase.GetStoredProcCommand("pa_evaluacion_registrar")
                Me.DataBase.AddOutParameter(command, "@id", DbType.Int32, objBE.Id)
                Me.DataBase.AddInParameter(command, "@fechaevaluacion", DbType.DateTime, objBE.Fecha)
                Me.DataBase.AddInParameter(command, "@tipo", DbType.String, objBE.TipoEvaluacion)
                Me.DataBase.AddInParameter(command, "@detalle", DbType.String, objBE.Detalle)
                Me.DataBase.AddInParameter(command, "@resumen", DbType.String, objBE.Resumen)

                If Me.DataBase.ExecuteNonQuery(command) > 0 Then
                    objBE.Id = DataBase.GetParameterValue(command, "@id")
                    Return True
                End If

                Return False
            End Using
        Catch ex As Exception
            ''ex.Message
            Throw
        End Try
    End Function


End Class
